#include <bits/stdc++.h>
using namespace std;
int points[4][2] = {{0, 0}, {2020, 11}, {11, 14}, {2000, 2000}};
int d[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
queue<pair<int, int> > q;
const int N = 10000;
bool vis[N][N] = { false };
int ans = 4;


// 多源bfs
// 如果用unordered_set来存储的话可能会消耗更长的时间
void bfs() {
    for (int time = 1; time <= 2020; time++) {
        int len = q.size();
        pair<int, int> p;
        for (int i = 1; i <= len; i++) {
            p = q.front(); q.pop();
            for (int i = 0; i < 4; i++) {
                int nx = p.first + d[i][0], ny = p.second + d[i][1];
                if (!vis[nx][ny]) {
                    q.push(make_pair(nx, ny));
                    ans++;
                    vis[nx][ny] = true;
                }
            }
        }
    }
}


int main(){
    for (int i = 0; i < 4; i++) {
        q.push(make_pair(points[i][0] + 3000, points[i][1] + 3000));
        vis[points[i][0] + 3000][points[i][1] + 3000] = true;
    }
    bfs();
    cout << ans << endl;
    return 0;
}